<%@ page import="com.example.javawebdemo.models.User" contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>首页 - 电商助农平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .card-hover:hover {
            transform: translateY(-5px);
            transition: all 0.3s ease;
        }
        .product-img {
            height: 200px;
            object-fit: cover;
        }
        .footer {
            background-color: rgba(25, 135, 84, 0.95);
        }
        .rating {
            color: #ffc107;
            font-size: 0.9rem;
        }
    </style>
</head>
<body class="d-flex flex-column min-vh-100">
<nav class="navbar navbar-expand-lg navbar-dark bg-success shadow-sm">
    <div class="container">
        <a class="navbar-brand fw-bold fs-4" href="management-Index.jsp">🌱 电商助农</a>
        <div class="ms-auto d-flex align-items-center">
            <% User user = (User) session.getAttribute("user"); %>
<%--            <span class="text-white me-3">欢迎回来，<span class="fw-bold"><%= user.getUsername() %></span></span>--%>
<%--            <a href="logout.jsp" class="btn btn-light rounded-pill px-4">退出登录</a>--%>
        </div>
    </div>
</nav>

<main class="flex-grow-1 container my-5">
    <h3 class="mb-4 fw-bold text-success">新鲜直达 · 当季优选</h3>

    <div class="row g-4">
        <!-- 商品卡片 -->
        <div class="col-md-4">
            <div class="card h-100 shadow-sm card-hover border-0">
                <img src="https://tse2-mm.cn.bing.net/th/id/OIP-C.CZWeFD1slMvE9j-3vlM3ZgHaE8?w=258&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7" class="card-img-top product-img rounded-top" alt="农产品">
                <div class="card-body">
                    <div class="d-flex justify-content-between mb-2">
                        <h5 class="card-title fw-bold text-success">高山有机绿茶</h5>
                        <div class="rating">★★★★☆</div>
                    </div>
                    <p class="card-text text-muted">来自海拔1200米的云雾茶园，早春头采嫩芽，天然无污染</p>
                    <div class="d-flex justify-content-between align-items-center">
                        <h4 class="text-danger fw-bold">¥128.00</h4>
                        <button class="btn btn-success rounded-pill px-4">立即购买</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card h-100 shadow-sm card-hover border-0">
                <img src="https://tse4-mm.cn.bing.net/th/id/OIP-C.fIJXyFmfv90Z1qmOg8qegQHaHa?w=169&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7" class="card-img-top product-img rounded-top" alt="农产品">
                <div class="card-body">
                    <div class="d-flex justify-content-between mb-2">
                        <h5 class="card-title fw-bold text-success">富硒沙地蜜薯</h5>
                        <div class="rating">★★★★★</div>
                    </div>
                    <p class="card-text text-muted">黄河故道沙地种植，富含硒元素，古法窖藏糖化15天</p>
                    <div class="d-flex justify-content-between align-items-center">
                        <h4 class="text-danger fw-bold">¥9.8/斤</h4>
                        <button class="btn btn-success rounded-pill px-4">立即购买</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card h-100 shadow-sm card-hover border-0">
                <img src="https://n.sinaimg.cn/sinakd20220907s/366/w700h466/20220907/a08b-64ba2ed528ec814810f9e8728209f6a1.jpg" class="card-img-top product-img rounded-top" alt="农产品">
                <div class="card-body">
                    <div class="d-flex justify-content-between mb-2">
                        <h5 class="card-title fw-bold text-success">现摘草莓</h5>
                        <div class="rating">★★★★★</div>
                    </div>
                    <p class="card-text text-muted">每天清晨现摘现发，颗颗精选，果香浓郁，新鲜直达</p>
                    <div class="d-flex justify-content-between align-items-center">
                        <h4 class="text-danger fw-bold">¥68.00/箱</h4>
                        <button class="btn btn-success rounded-pill px-4">立即购买</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>

<footer class="footer mt-auto py-4 text-white">
    <div class="container text-center">
        <div class="mb-3">
            <a href="#" class="text-white text-decoration-none me-4">关于我们</a>
            <a href="#" class="text-white text-decoration-none me-4">助农政策</a>
            <a href="#" class="text-white text-decoration-none">联系我们</a>
        </div>
        <p class="mb-0">© 2025 电商助农平台 保留所有权利</p>
        <p class="mb-0">助力乡村振兴，我们在行动！</p>
    </div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
